using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Component;

public partial class admin : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Sessions.LanguageVN = true;
        if (Sessions.CurrentUser == null)
        {
            Response.Redirect("Login.aspx");
        }
        else
        {
            this.ChooseControl(this.GetQuery());
            //ContentManagement contentMana = ContentManagementDB.GetObjectByid(18, true);
            //if (contentMana.Priority == 1)
            //{
            //    this.rbnPublic.Checked = true;
            //}
            //else
            //    this.rbnUnPublic.Checked = true;
        }
    }
    // fuction load control
    void LoadControlInCenter(string controlPath)
    {
        this.pnCenter.Controls.Clear();
        this.pnCenter.Controls.Add(LoadControl(controlPath));
    }
    // function get query
    string GetQuery()
    {
        try
        {
            return QueryHelper.GetQueryString(Request, ConstString._wand);
        }
        catch
        {
            return "";
        }
    }
    // func choose control
    void ChooseControl(string query)
    {
        this.pnTopmenu.Controls.Add(LoadControl(BackEndPath._TopMenu));
        switch (query)
        {

            case BackEndQuery._ColorL:
                LoadControlInCenter(BackEndPath._ColorL);
                break;
        }
    }

    protected void rbnPublic_CheckedChanged(object sender, EventArgs e)
    {
        this.rbnUnPublic.Checked = false;
        //ContentManagement contentMana = ContentManagementDB.GetObjectByid(18, true);
        //contentMana.Priority = 1;
        //contentMana.Save();

    }
    protected void rbnUnPublic_CheckedChanged(object sender, EventArgs e)
    {
        this.rbnPublic.Checked = false;
        //ContentManagement contentMana = ContentManagementDB.GetObjectByid(18, true);
        //contentMana.Priority = 0;
        //contentMana.Save();

    }
}
